/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package publics.events;

import entity.Event;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author Marta
 */

@ManagedBean
@ViewScoped
public class beansPublicEvents  implements Serializable {
    
    private List<Event> previewEvents;

    public List<Event> getPreviewEvents() {
        return previewEvents;
    }

    public void setPreviewEvents(List<Event> previewEvents) {
        this.previewEvents = previewEvents;
    }

    public eventPreviewLoader getLoader() {
        return loader;
    }

    public void setLoader(eventPreviewLoader loader) {
        this.loader = loader;
    }
    
    @ManagedProperty("#{eventPreviewLoader}")
    private eventPreviewLoader loader;
     
    @PostConstruct
    public void init() {
        previewEvents = loader.loadList();
    }

}
